from apps.vadmin.auth.schemas import User
from crewplus.apps.account.schemas.password import Password
from pydantic import ConfigDict
from core.data_types import DatetimeStr


class AccountRegisterIn(User):
    """
    创建用户
    """
    role_ids: list[int] = []
    password: Password
    is_reset_password: bool = True


class AccountRegisterOut(User):
    model_config = ConfigDict(from_attributes=True)

    id: int
    update_datetime: DatetimeStr
    create_datetime: DatetimeStr

    is_reset_password: bool = True
    last_login: DatetimeStr | None = None
    last_ip: str | None = None
